package com.gosophia.resource.action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.commons.web.bean.RequestResult;
import com.gosophia.resourcePermission.dto.RuleDTO;
import com.gosophia.resourcePermission.ws.ResourcePermissionWebService;
import com.gosophia.util.RequestResultUtil;

/***
 * 查询指定规则
 * 
 * @author zhao_yanfang
 * 
 */
@Controller("findRuleByIdAction")
@Scope("prototype")
public class FindRuleByIdAction extends BaseSupportAction {
	private static final Log logger = LogFactory
			.getLog(ShowResourcePageAction.class);
	private long ruleId;
	private RuleDTO ruleDTO;
	@Autowired
	private ResourcePermissionWebService resourcePermissionWebService;

	public String _execute() throws Exception {
		logger.info("查询指定规则:" + ruleId);
		ruleDTO = resourcePermissionWebService.findRuleById(ruleId);
		return SUCCESS;
	}

	public long getRuleId() {
		return ruleId;
	}

	public void setRuleId(long ruleId) {
		this.ruleId = ruleId;
	}

	public RuleDTO getRuleDTO() {
		return ruleDTO;
	}

	public void setRuleDTO(RuleDTO ruleDTO) {
		this.ruleDTO = ruleDTO;
	}

}
